<script>
export default {
  name: "StuView",
  data() {
    return {
      stus: [],
      keyword: ''
    }
  },
  methods: {
    loadStus(){
      this.$axios.get('/selectAll')
          .then(result => {
            if (result.data.code === 200) {
              this.stus = result.data.data
            }
          })
    }
  },
  mounted() {
    this.loadStus()
  }
}
</script>

<template>
  <el-table :data="stus" style="width: 100%">
    <el-table-column label="编号" prop="id" />
    <el-table-column label="姓名" prop="name" />
    <el-table-column label="年龄" prop="age" />
    <el-table-column label="性别" prop="gender" />
    <el-table-column label="电话" prop="cellphone" />
    <el-table-column label="籍管" prop="address" />

    <el-table-column align="right">
      <template #header>
        <el-input v-model="keyword" size="small" placeholder="搜索学生" />
      </template>

      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.$index, scope.row)">
          Edit
        </el-button>
        <el-button
            size="small"
            type="danger"
        >
          Delete
        </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>


<style scoped>

</style>